/*
 * To change this template, choose Tools | Templates and open the template in
 * the editor.
 */
package SteamEngineDB;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author Jeff Bendixsen <jeff@westcoastcode.com>
 */
@Embeddable
public class TemplateCarPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "RUN_ID")
    private int runId;
    @Basic(optional = false)
    @Column(name = "CAR_ID")
    private int carId;

    public TemplateCarPK() {
    }

    public TemplateCarPK(int runId, int carId) {
        this.runId = runId;
        this.carId = carId;
    }

    public int getRunId() {
        return runId;
    }

    public void setRunId(int runId) {
        this.runId = runId;
    }

    public int getCarId() {
        return carId;
    }

    public void setCarId(int carId) {
        this.carId = carId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) runId;
        hash += (int) carId;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TemplateCarPK)) {
            return false;
        }
        TemplateCarPK other = (TemplateCarPK) object;
        if (this.runId != other.runId) {
            return false;
        }
        if (this.carId != other.carId) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "SteamEngineDB.TemplateCarPK[ runId=" + runId + ", carId=" + carId + " ]";
    }
    
}
